package com.gaoshi.chapter5;

import java.util.ArrayList;

/**
 * This program uses reflection to spy on objects.
 */
public class ObjectAnalyzerTest {
    public static void main(String[] args) throws IllegalAccessException {
        ArrayList<Integer> squares = new ArrayList<>();
        for (int i = 1; i <= 5; i++) {
            squares.add(i * i);
        }
        // JDK 9 之后，在 IDEA 里的 Run Configurations 中添加 VmM options，配置 --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED，就可以运行了
        System.out.println(new ObjectAnalyzer().toString(squares));
    }
}
